package gp;

class Division extends Function {

	Division() {
		arg = new Program[2];
	}

	String getName() {
		return "div";
	}

	double eval(double x) {
		double divisor = arg[1].eval(x);
		return (divisor == 0 ? 1 : arg[0].eval(x) / divisor);
	}

}